import request from '@/utils/request';

let baseURL = '/property-portal/v1/api';

// 巡检点位项目列表
export const inspectProjectListApi = params => {
	return request({
		url: `${baseURL}/point/queryProjectPointList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划项目列表
export const InspectPlanProjectListApi = params => {
	return request({
		url: `${baseURL}/planInspection/queryProjectInspectionList`,
		method: 'post',
		data: params,
	});
};

// 巡检点位-新增--------------------------------------------------------------------巡检----------------------------------------------------------------------
export const inspectAddApi = params => {
	return request({
		url: `${baseURL}/point/create`,
		method: 'post',
		data: params,
	});
};

// 巡检点位-更新
export const inspectUpdateApi = params => {
	return request({
		url: `${baseURL}/point/update`,
		method: 'post',
		data: params,
	});
};

// 巡检点位-详情
export const inspectInfoApi = params => {
	return request({
		url: `${baseURL}/point/detail/${params}`,
		method: 'get',
	});
};

// 巡检点位-列表
export const inspectListApi = params => {
	return request({
		url: `${baseURL}/point/queryPointList`,
		method: 'post',
		data: params,
	});
};

// 巡检点位二维码
export const inspectQrCodeDownloadApi = params => {
	return request({
		url: `${baseURL}/point/download`,
		method: 'post',
		data: params
	});
};

// 巡检记录
export const inspectRecordListApi = params => {
	return request({
		url: `${baseURL}/planMaintenance/maintenanceDeviceBind`,
		method: 'post',
		data: params,
	});
};

//设备二维码批量下载
export const batchDownloadApi = params => {
	return request({
		url: `${baseURL}/point/downloadZip`,
		method: 'post',
		data: params,
		responseType: 'blob',
	});
};

// 巡检标准-新增-----------------------------------------------------------------巡检标准-----------------------------------------------------------------
export const standardAddApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/createInspectionStandard`,
		method: 'post',
		data: params,
	});
};

// 巡检标准-更新
export const standardUpdateApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/updateInspectionStandard`,
		method: 'post',
		data: params,
	});
};

// 巡检标准-详情
export const standardInfoApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/findInspectionStandardView`,
		method: 'post',
		data: params,
	});
};

// 巡检标准-列表
export const standardListApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/inspectionStandardList`,
		method: 'post',
		data: params,
	});
};

// 配置保存
export const standardConfigSaveApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/saveInspectionStandardDetail`,
		method: 'post',
		data: params,
	});
};

// 配置详情
export const standardConfigInfoApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/findInspectionStandardDetailView`,
		method: 'post',
		data: params,
	});
};

// 巡检标准-引用功能绑定
export const planQuoteBindApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/quote`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-列表--------------------------------------------------------------巡检计划-----------------------------------------------------------------
export const planListApi = params => {
	return request({
		url: `${baseURL}/planInspection/queryInspectionList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划的计划绑定后调后的回调
export const planBindCbApi = params => {
	return request({
		url: `${baseURL}/planInspection/savePlanInspectionStatus`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-新增
export const planAddApi = params => {
	return request({
		url: `${baseURL}/planInspection/create`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-更新
export const planUpdateApi = params => {
	return request({
		url: `${baseURL}/planInspection/update`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-详情
export const planInfoApi = params => {
	return request({
		url: `${baseURL}/planInspection/detail/${params}`,
		method: 'get',
	});
};

// 巡检计划-可选择的设备点位列表
export const planPointListApi = params => {
	return request({
		url: `${baseURL}/planInspection/queryPointList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-绑定过的设备点位列表
export const planPointBoundListApi = params => {
	return request({
		url: `${baseURL}/planInspection/queryInspectionPointList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-设备点位绑定
export const planPointBindApi = params => {
	return request({
		url: `${baseURL}/planInspection/inspectionPointBind`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-点位排序列表
export const planPointSortListApi = params => {
	return request({
		url: `${baseURL}/planInspection/orderPointList/${params}`,
		method: 'get'
	});
};

// 巡检计划-点位排序
export const planPointSortApi = params => {
	return request({
		url: `${baseURL}/planInspection/order`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-流程查询
export const planProcessDropApi = params => {
	return request({
		url: `${baseURL}/planInspection/processDropDown`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-角色查询
export const planRoleDropApi = params => {
	return request({
		url: `${baseURL}/planInspection/queryRoleKeyList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-标准详情（有是否选中标识）
export const standradChooseListApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/queryInspectionStandardDetailList`,
		method: 'post',
		data: params,
	});
};

// 巡检计划-标准-绑定
export const standradBindApi = params => {
	return request({
		url: `${baseURL}/inspectionStandard/inspectionStandardPointBind`,
		method: 'post',
		data: params,
	});
};